/**
 * 通用接口
 */
import type { SendCodeParams, SendCodeResult, UploadImageResult } from './types';
import { post, upload } from '@renderer/utils/request';

enum URL {
  upload = '/common/upload',
  sendCode = '/sendCode',
}

// 图片上传
export const uploadImage = (imagePath: string) =>
  upload<UploadImageResult>({ url: URL.upload, filePath: imagePath, name: 'file' });

// 发送验证码
export const sendCode = (data: SendCodeParams) => post<SendCodeResult>({ url: URL.sendCode, data });

export const querySpaceModelTree = (data: any) => post<any>({ url: '/lcmp/api/spaceModel/querySpaceModelTree', data });

//查询设备概览
export const queryDeviceOverview = (data: any) => post<any>({ url: '/lcmp/api/wx/wechatDevice/queryDeviceOverview', data });
//查询列表
export const queryDeviceList = (data: any) => post<any>({ url: '/lcmp/api/wx/wechatDevice/queryDeviceListByPaging', data });

// 测试发送语音播报
export const sendText = (data: any) => post<any>({ url: '/omz/api/voices/sendVoid', data });
